<?php
	if(isset($_SESSION['id'])){
	$Model=new \Common\Model\User;
	$userData=$Model->where('uid',$_SESSION['id'])->find();
//	var_dump($userData);die;
	}	
	
	$cateModel=new \Common\Model\Cate;
	   
	$leaderData=$cateModel->orderBy('cid','ASC')->get();
	   
	$leaderData=Data::channelLevel($leaderData); 
			
//		p($leaderData);die;

	View::with('leaderData',$leaderData);
	
	if(isset($_SESSION['cart'])){
	
		$cartData=$_SESSION['cart'];
//		p($cartData);
		View::with('cartData',$cartData);
	};	
	?>


<header>
			<script type="text/javascript">
//			alert(2);
				$(function(){
					$('.top_left').hover(
						function(){
						$('.dis_top').css({display:"block"});
						$('.top_left').css({background:"#dcdcdc"});
					},
						function(){
						$('.dis_top').css({display:"none"});
						$('.top_left').css({background:"#f4f4f4"});
					});										
				})
			</script>
			<div class="top">
				<div class="top_w">	
					<div class="top_left">
						 <a href="<?php echo U('Home/Index/index')?>" class="top_left_a">YOHO!有货</a>
						 <ul class="dis_top">
						 	<li><a href="">YOHO!</a></li>
						 	<li><a href="">YOHO!BOYS</a></li>
						 	<li><a href="">YOHO!GIRLS</a></li>
						 	<li><a href="">YOHO!SHOW</a></li>
						 	<li><a href="">YO'HOOD</a></li>
						 </ul>
					</div>
						
					 <div class="top_right">
					 	<?php if(isset($_SESSION['id'])){?>
                						 	
					 	Hi~<?php echo $userData['username']?><a href="<?php echo U('Home/Login/out')?>">[退出]</a>
					 	<?php }else{?>
					 	<a href="<?php echo U('Home/Login/login')?>">Hi~[请登录]</a>
					 	<a href="<?php echo U('Home/Login/reg')?>">[免费注册]</a>	
					 	
               <?php }?>
						 <a href="<?php echo U('Home/userCenter/information',array('uid'=>$_SESSION['id']))?>"><span>|</span>MY有货</a>
						 <a href="<?php echo U('Home/Usercenter/orderList')?>"><span>|</span>我的订单</a>
						 <a href=""><span>|</span>我的收藏</a>
						 <a href=""><span>|</span>消息</a>
						 <a href=""><span>|</span>手机版</a>
					 </div>
				 </div>
			</div>
			<div class="nav">
				<div class="nav_w">
					<ul>
						<li style="background: #3a3a3a; ">
							<a class="nav_a1" href="" style="color: #fff;">男生</a>
							<a class="nav_a2" href="" style="color: #fff;">BOYS</a>
						</li>
						<li>
							<a class="nav_a1" href="">女生</a>
							<a class="nav_a2" href="">GIRLS</a>
						</li>
						<li>
							<a class="nav_a1" href="">潮童</a>
							<a class="nav_a2" href="">KIDS</a>
						</li>
						<li>
							<a class="nav_a1" href="">创意生活</a>
							<a class="nav_a2" href="">LIFE STYLE</a>
						</li>
					</ul>
					<div class="banner"></div>
					<div class="search">
						<input class="searchinput" type="text" name="" id="" value="" />
						<a href="" class="iconsearch"></a>
						<span >
							<?php if(!empty($cartData)){?>
                
								<div class="shopping">
									<span id="ic-infomation"><?php echo $cartData['total_rows']?></span>
									<div class="gobuy-empty" style="background: #fff;">
										<ul >
											<?php foreach ($cartData['goods'] as $k=>$v){?>
											<li>
												<div class="gb gb_1">
													<img src="<?php echo $v['options']['pic']?>" style="width: 46px;height: 62px;"/>
												</div>
												<div class="gb gb_2">
													<span ><?php echo $v['name']?></span>	
													<span >颜色:<?php echo $v['color']?> &nbsp; 尺码:<?php echo $v['size']?></span>	
												</div>
												<div class="gb gb_3">
													<span >￥<?php echo $v['price']?> x <?php echo $v['num']?></span>	
													<a href="<?php echo U('Cart/index')?>">查看</a>	
												</div>
											</li>
											<?php }?>
										</ul>										
									</div>
								</div>
							<?php }else{?>
								<div class="shopping">
									<span id="ic-infomation">0</span>
									<div class="gobuy-empty">
										<h3 class="information">您的购物车暂无商品</h3>
									</div>
								</div>
							
               <?php }?>
						</span>
					</div>
				</div>
				<script type="text/javascript">
					$(function(){
						$('.shopping').hover(
							function(){
								$(this).children(".gobuy-empty").css({display:"block"});
							},
							function(){
								$(this).children(".gobuy-empty").css({display:"none"});
							}
						);
						

					})
				</script>
				<script type="text/javascript">
					$(function(){

					})
				</script>
				<div class="nav_leader">
					<ul>
						<?php foreach ($leaderData as $k=>$v){?>
						<li id="dis_li" >
							<a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" cname="<?php echo $v['cname']?>"><?php echo $v['cname']?></a>
							<?php if(empty($v['_data'])){?>
                
							<?php }else{?>
							<div class="dis_leader" id="dis">
								<div class="dis_le1">
									<?php foreach ($v['_data'] as $kk=>$vv){?>
									<div class="dis_list" >
										<ul><a href="<?php echo U('List/index',array('cid'=>$vv['cid']))?>" style="color: #000;"><b><?php echo $vv['cname']?></b></a>
											<?php foreach ($vv['_data'] as $kkk=>$vvv){?>
											<li><a href="<?php echo U('List/index',array('cid'=>$vvv['cid']))?>" style="color: #000;"><?php echo $vvv['cname']?></a></li>
											<?php }?>
										</ul>
									</div>
									<?php }?>
									<div class="dis_list">
										<img src="./public/admin/images/banner7.jpg"/>
									</div>
								</div>
							</div>
							
               <?php }?>
						</li>
						<?php }?>
					</ul>
				</div>

			</div>
		</header>